<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2018/4/23
  Time: 8:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->


    <!--引入 jQuery 文件 -->
    <script src="./jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="./bootstrap/bootstrap/css/bootstrap.css">
    <script src="./bootstrap/bootstrap/js/bootstrap.js"></script><!--引入 限制登陆样式css -->
    <link href="./bootstrap/signin.css" rel="stylesheet">
    <script src="./uploadify/jquery.uploadify.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="./uploadify/uploadify.css">

    <title>网易理财</title>
    <style type="text/css">
        #testa{
            position: absolute;
            top:48%;
            left:60%;
            width: 300px;
            float: right;
        }

        .form-signin{
            position: relative;
            margin-left: 1.6%;margin-top:7%;

        }

        #ss{
            position: absolute;
            margin-left: 96%;
            margin-top: -13%;
            width:200px;
            height:30px;
            color: red;
        }
        #box{background-image:url("/photos/5.jpg");background-position:center center;background-repeat:no-repeat;background-size:cover;}

    </style>


</head>
<body id="box">


<div class="container"  style="position: absolute;left: 40%" >

  <form class="form-signin" id="form4"  enctype="multipart/form-data">

      <label  style="text-indent:2em;">手机号：</label>
      <input name="companyPersonPhone" type="text"  class="form-control" placeholder="登录的手机号：+86:" required autofocus ><br><br>
      <label  style="text-indent:2em;">任证书：</label>
    <div id="queue"></div>
    <input id="file_upload" type="file" name="photos" />
    <div id="imglist"></div>
    <input type="hidden" name="companyPhoto"  id="imgpath" />


      <input  type="button" class="btn btn-lg btn-primary btn-block" value="注册" id="regbtn"/><br><br>
      <a href="/companylogin.jsp" >
          <div style="border:1px solid #FBAF37;background:#fff;color:#FBAF37;width:43%;padding:10px 20px;border-radius: 5px; margin-left: 6.3em;text-align: center;" class="ss check3">
             去企业登录
          </div>
      </a><br>
  </form>

</div> <!-- /container -->

<script type="text/javascript">

    $("#regbtn").click(function(){

        $.ajax({

            url:"http://localhost:8077/login/regCompany",
            data:$("#form4").serialize(),
            type:"post",
            success:function(result){

                alert(result)
                if(result=="注册成功"){

                    location.href="/haha.jsp"
                }else{

                    location.href="/companyreg.jsp"
                }

            }

        })


    })

</script>


<script type="text/javascript">

    $(function() {

        $('#file_upload').uploadify({

            'swf'      : './uploadify/uploadify.swf',//动画地址
            'uploader' : 'http://localhost:8077/login/uploadphoto',  //上传的action地址
            'fileTypeExts'  :   '*.gif;*.jpg;*.png;*.bmp',  //允许上传的文件格式
            'multi'             :   false,   //是否开启多文件上传
            'method'            :   'post', //提交方式
            'fileObjName':'photos',    //服务器 接收的文件名称

            'onUploadSuccess' : function(file,data) {
                //参数data服务端输出返回的信息

                //alert(data)

                //$("#imglist").append("<img  src='//upload/"+data+"'  width=30 height=30  />")

               $("#imglist").html("<img  src='http://localhost:8080/upload/1524570491482.gif'  width=60 height=60  />")

                $("#imgpath").val(data);
            },
        });
    });


</script>

</body>


<%--
<script>


    /*$("#regbtn").click(function(){

        $.ajax({
            url:"http://localhost:8077/login/regCompany",
            type:"Post",
            data:$("#form3").serialize(),
            success:function(result){

                //console.log(result)
                alert(result);

                if(result=="登录成功"){

                    location.href="/haha.jsp"
                }else{

                    location.href="/companyreg.jsp"
                }

            }

        });
    })*/


</script>--%>
<%--


<script type="text/javascript">



function aaaaaaaa(){

    var formData = new FormData($('form')[0]);

    $.ajax({
        url:"http://localhost:8077/login/regCompany",
        type: 'POST',
        //Ajax events
        //beforeSend: beforeSendHandler,
        //success: completeHandler,
        //error: errorHandler,
        // Form data
        data: formData,
        //Options to tell jQuery not to process data or worry about content-type.
        cache: false,
        contentType: false,
        processData: false,
        success:function(result){

            alert(111111111)

        }})




}



</script>
--%>
</html>
